#include "prjinfo.h"
#include <stdint.h>
#include <string.h>

#define PRJNAME  "application" /*!< project name */
#define MAJOR   1 /*!< major version */
#define MINOR   0 /*!< minor version */
#define REVISION   0 /*!< revision */

#if defined(__CC_ARM) || defined(__ARMCC_VERSION) /* Keil */
#if defined(__CC_ARM)                             /* AC5 */
#define __AT(__ADDR) __attribute__((at(__ADDR), used))
#elif defined(__ARMCC_VERSION) /* AC6 */
#define __AT(__ADDR) __attribute__((section(".ARM.__at_" #__ADDR)))
#endif /* __CC_ARM */
#define AT_ADDR(__ADDR) __AT(__ADDR)
const project_info_t project_info AT_ADDR(PROJECT_INFO_ADDR) =
#elif defined(__ICCARM__) /* IAR */
#define AT_ADDR(__ADDR) __AT(__ADDR)
#pragma location = PROJECT_INFO_ADDR
__root const project_info_t project_info @PROJECT_INFO_ADDR =
#else
#error Not select compiler.
#endif /* __CC_ARM || __ARMCC_VERSION */
    {
        .name = PRJNAME,
        .ver_major = MAJOR,
        .ver_minor = MINOR,
        .ver_revision = REVISION,
        .build_date = __DATE__,
        .swver = VER_AS_INT(MAJOR,MINOR,REVISION),
        .build_time = __TIME__,
    };
project_info_t* PrjInfoGet(uint32_t firmwareaddr)
{
    return (project_info_t*)firmwareaddr;
}
